package bancosys.tec.security.impl.dao;

import java.util.List;

import jmine.tec.persist.schema.impl.elements.SequenceElement;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.dao.BaseDAO;
import bancosys.tec.security.impl.domain.MetaCredential;

/**
 * @author lundberg
 */
public class MetaCredentialDAO extends BaseDAO<MetaCredential> {

    /**
     * Busca todas as credenciais em postscript.
     * 
     * @return List de Credential
     */
    public List<MetaCredential> findAllPostscriptCredentials() {
        Criteria criteria = this.createCriteria();
        criteria.add(Restrictions.lt("id", SequenceElement.DEFAULT_INITIAL_VALUE));
        criteria.addOrder(Order.asc("id"));
        return this.executeQuery(criteria);
    }
}
